<template>
  <ElementDialog
    ref="dialog"
    :body-padding="false"
    show-full-screen
    embed
    title="流程跟踪"
    height="500px"
    :visible="visible"
    v-on="$listeners"
    @toggle-fullscreen="fitViewportCenter">
    <FlowProgressView ref="flowProgressView" :business-key="businessKey" />
  </ElementDialog>
</template>

<script>
  import FlowProgressView from './FlowProgressView.vue'
  export default {
    name: 'FlowProgressViewDialog',
    components: {
      FlowProgressView
    },
    props: {
      visible: Boolean,
      businessKey: {
        type: String,
        default: ''
      }
    },
    methods: {
      async fitViewportCenter() {
        await this.$nextTick()
        this.$refs.flowProgressView.fitViewportCenter()
        this.$refs.flowProgressView.fitViewportCenter()
      }
    }
  }
</script>
